<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>欢迎光临</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">

	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/main.css">


  </head>
  
  <body>
    <div style="text-align: right;">
		    <a href="${pageContext.request.contextPath}">首页</a>
		    
		    <c:if test="${sessionScope.customer==null }">
			    <a href="${pageContext.request.contextPath}/login.jsp">登录</a>
			    <a href="${pageContext.request.contextPath}/regist.jsp">注册</a>
		    </c:if>
		    
		    <c:if test="${sessionScope.customer!=null }">
    			欢迎您：${sessionScope.customer.username }
    			<a href="${pageContext.request.contextPath}/servlet/ControllerServlet?op=logout">注销</a>
    			<a href="${pageContext.request.contextPath}/servlet/ControllerServlet?op=showMyOrders">我的订单</a>
    		</c:if>
		    
		    <a href="${pageContext.request.contextPath}/showCart.jsp">我的购物车</a>
    </div>
    <br>
    <br>
    <div>
		    <h1>xxx的小书屋</h1>
    </div>
    <br>
    <br>
    <div>
		   
		   <c:forEach items="${cs}" var="c">
		   		<a href="${pageContext.request.contextPath}/servlet/ControllerServlet?op=listBookByCategory&categoryId=${c.id}">${c.name}</a>
		   </c:forEach>
    </div>
    <br>
    <br>
  </body>
</html>
